<template>
  <el-tabs type="border-card" @tab-click="clickTab">
    <el-tab-pane label="所有OKR"
      ><AllOKR :type="type" ref="allOKR"></AllOKR
    ></el-tab-pane>
    <el-tab-pane label="由我创建"
      ><CreatedByMe :type="type" ref="createdByMe"></CreatedByMe
    ></el-tab-pane>
    <el-tab-pane label="由我审核"
      ><CheckingByMe :type="type" ref="checkingByMe"></CheckingByMe
    ></el-tab-pane>
  </el-tabs>
</template>

<script>
import AllOKR from "./common/AllOKR.vue";
import CreatedByMe from "./common/CreatedByMe.vue";
import CheckingByMe from "./common/CheckingByMe.vue";
export default {
  name: "UserObjective",
  components: {
    AllOKR,
    CreatedByMe,
    CheckingByMe,
  },
  data() {
    return {
      type: 3,
    };
  },
  methods: {
    clickTab(targetName) {
      switch (targetName.index) {
        case "0":
          this.$refs.allOKR.getListObject();
          break;
        case "1":
          this.$refs.createdByMe.getListObject();
          break;
        case "2":
          this.$refs.checkingByMe.getListObject();
          break;
      }
    },
  },
};
</script>

<style scoped>
</style>>